﻿var fs = require('fs');
var zlib = require('zlib');

fs.createReadStream('zip.txt')
  .pipe(zlib.createGzip())
  .pipe(fs.createWriteStream('zip.txt.gz'))

console.log("文件压缩完成")






















